Skip to content
This repository has been archived by the owner on May 11, 2022. It is now read-only.

Bug fix #7

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Bug fix #7

wants to merge 2 commits into from

Conversation

nicaurvi
Copy link

@nicaurvi nicaurvi commented Jul 1, 2014

Fixed a bug where mHeading's range was (-6, 354) instead of (0, 360)

Fixed a bug where mHeading's range was (-6, 354) instead of (0, 360)
Accidentally removed magneticHeading declaration and initialization
@nicaurvi
Copy link
Author

nicaurvi commented Apr 2, 2015

Anyone?

@@ -135,8 +135,12 @@ public void onSensorChanged(SensorEvent event) {
// Convert the heading (which is relative to magnetic north) to one that is
// relative to true north, using the user's current location to compute this.
float magneticHeading = (float) Math.toDegrees(mOrientation[0]);
mHeading = MathUtils.mod(computeTrueNorth(magneticHeading), 360.0f)
- ARM_DISPLACEMENT_DEGREES;
mHeading = MathUtils.mod(computeTrueNorth(magneticHeading), 360.0f) - ARM_DISPLACEMENT_DEGREES;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using this should do the trick instead of the test block below:
mHeading = MathUtils.mod(computeTrueNorht(magneticHeading) - ARM_DISPLACEMENT_DEGREES, 360.0f);

Also, please make sure to follow Android's coding style standard:
https://source.android.com/source/code-style.html

Specifically, use spaces instead of tabs and keep the lines below 100 characters.

@allevato allevato removed their assignment May 22, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants